# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fping
pkgver=5.1
pkgrel=5
pkgdesc="A utility to ping multiple hosts at once"
url="https://fping.org/"
arch="all"
license="MIT"
makedepends="libcap-utils"
subpackages="$pkgname-doc"
source="https://fping.org/dist/fping-$pkgver.tar.gz
	int-conversion.patch
	unprivileged-ping.patch
	"
# setcap: needs cap_net_raw to be able to send icmp packets
options="!check setcap" # no testsuite

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--enable-ipv6
	make
}

package() {
	make install DESTDIR="$pkgdir"
	setcap cap_net_raw=+ep "$pkgdir"/usr/sbin/fping
}

sha512sums="
1a208da8dcd99093d0512af5d85ba5e7b5743ec97993d24c1fe612bb58d93090ac1ba0952f648aa075f16d390a77c4be65e394ae56dbede2a6914e0e8c68e2bd  fping-5.1.tar.gz
aac9c7906b44f65eb586b4de50cb6b10c6d99b1a2f7fc2ea030491a23e174500dac945ebe9ad8a85a38da0bac4c3883aa41c6ebf980480de02ded709f76bde38  int-conversion.patch
57fb8976a382ef21200430a238985cec04ecb72458e67d02ae4eac3af4f14108ad90460d562ee9f46a579d6226335b9391542c641acd2c6e1736fa138176e52f  unprivileged-ping.patch
"
